public class test {
    //蓝桥杯 拓扑排序
    public class Main {
        public static int n;
        public static int m;
        public static int[] dis;
        public static List<Integer>[] list;
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            n = in.nextInt();
            m = in.nextInt();
            //用于存储i以及i可以到达的点
            list = new ArrayList[n + 1];
            //用于存储某个点i的入度
            dis = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                list[i] = new ArrayList<>();
            }
            for (int j = 1; j <= m; j++) {
                int a = in.nextInt();
                int b = in.nextInt();
                list[a].add(b);
                dis[b]++;
            }
            int sum = 0;
            ArrayList<Integer> arr = new ArrayList<>();
            PriorityQueue<Integer> queue = new PriorityQueue<>();
            for (int i = 1; i <= n; i++) {
                if (dis[i] == 0) {
                    queue.add(i);
                }
            }
            while (!queue.isEmpty()) {
                int index = queue.poll();
                arr.add(index);
                for (int a : list[index]) {
                    dis[a]--;
                    //如果入度为0
                    if (dis[a] == 0) {
                        queue.add(a);
                    }
                }

            }
            if (arr.size() != n) {
                System.out.println(-1);
            } else {
                for (int i = 0; i < arr.size(); i++) {
                    System.out.print(arr.get(i) + " ");
                }
            }
        }
    }
    //蓝桥杯 幸运数字(⭐⭐)
    public static void main(String[] args) throws IOException{
        //记录出现的幸运数字的个数
        int n = 0;
        int h = 1;
        while(n < 2023) {
            //查找幸运数字
            if(flg(h, 2) && flg(h, 8) && flg(h, 10) && flg(h, 16)) {
                n++;
                //System.out.println("第" + n + "个幸运数字为: " + h);
            }
            if(n == 2023) {
                System.out.println(h);
            }
            h++;
        }

    }
    //x代表需要操作的数
    //k代表检验的位数
    //126
    public static boolean flg(int x,int k) {
        int sum = 0;
        int head = x;
        while(x != 0) {
            sum += (x % k);
            x /= k;
        }
        return head % sum == 0;
    }
    
}
